package com.basic.thread.model;

/**
 * 
 * <p>
 * 
 *
 * @author <a href="mailto:lysongfei@gmail.com">songfei</a>
 * @version 1.0, 2013-4-8
 */
public class BankAccount {
	private int money;
	
	public BankAccount(int money) {
		this.money = money;
	}

	public int getMoney() {
		return money;
	}


	public synchronized void deposit(int amount) {
		System.out.println("Deposit Money : " + money);
		money = money + amount;
	}
	
	public synchronized void withdraw(int amount) {
		System.out.println("Withdraw Money : " + money);
		money = money - amount;
	}
	
	
}
